<?php

/**
 * Stoc form base class.
 *
 * @package    vvberp
 * @subpackage form
 * @author     Flo
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 16976 2009-04-04 12:47:44Z fabien $
 */
class BaseStocForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'depozit_id'   => new sfWidgetFormPropelChoice(array('model' => 'Adresa', 'add_empty' => false)),
      'produs_id'    => new sfWidgetFormPropelChoice(array('model' => 'Produs', 'add_empty' => false)),
      'cod_bare'     => new sfWidgetFormInput(),
      'cantitate'    => new sfWidgetFormInput(),
      'pret_intrare' => new sfWidgetFormInput(),
      'data_intrare' => new sfWidgetFormDateTime(),
      'adaos_iesire' => new sfWidgetFormInput(),
      'data_iesire'  => new sfWidgetFormDateTime(),
      'created_at'   => new sfWidgetFormDateTime(),
      'updated_at'   => new sfWidgetFormDateTime(),
      'created_by'   => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => true)),
      'updated_by'   => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorPropelChoice(array('model' => 'Stoc', 'column' => 'id', 'required' => false)),
      'depozit_id'   => new sfValidatorPropelChoice(array('model' => 'Adresa', 'column' => 'id')),
      'produs_id'    => new sfValidatorPropelChoice(array('model' => 'Produs', 'column' => 'id')),
      'cod_bare'     => new sfValidatorInteger(array('required' => false)),
      'cantitate'    => new sfValidatorInteger(array('required' => false)),
      'pret_intrare' => new sfValidatorNumber(array('required' => false)),
      'data_intrare' => new sfValidatorDateTime(array('required' => false)),
      'adaos_iesire' => new sfValidatorNumber(array('required' => false)),
      'data_iesire'  => new sfValidatorDateTime(array('required' => false)),
      'created_at'   => new sfValidatorDateTime(array('required' => false)),
      'updated_at'   => new sfValidatorDateTime(array('required' => false)),
      'created_by'   => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id', 'required' => false)),
      'updated_by'   => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id', 'required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Stoc', 'column' => array('cod_bare')))
    );

    $this->widgetSchema->setNameFormat('stoc[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Stoc';
  }


}
